/* 按钮通用样式库 
 * 用法:
 * 1. 在页面中引入: @import '@/styles/button.scss';
 * 2. 在元素上使用对应的类名，如 <view class="btn btn-primary">按钮</view>
 */

// 基础按钮样式
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 30rpx;
  font-size: 32rpx;
  border-radius: 45rpx;
  height: 90rpx;
  border: none;
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
  
  &:active {
    opacity: 0.85;
  }
}

// 按钮宽度
.btn-block {
  width: 100%;
}

.btn-auto {
  width: auto;
}

.btn-medium {
  width: 320rpx;
}

// 按钮类型
.btn-primary {
  background-color: #1677FF;
  color: #FFFFFF;
  
  &:active {
    background-color: #0e5ecc;
  }
}

.btn-secondary {
  background-color: #f5f5f5;
  color: #666;
  border: 2rpx solid #e6e6e6 !important ;
  
  &:active {
    background-color: #e8e8e8;
  }
  &:after{
    border:none !important;
  }
}

.btn-danger {
  background-color: #ff4d4f;
  color: #FFFFFF;
  
  &:active {
    background-color: #cf1322;
  }
}

.btn-success {
  background-color: #52c41a;
  color: #FFFFFF;
  
  &:active {
    background-color: #389e0d;
  }
}

.btn-warning {
  background-color: #fa8c16;
  color: #FFFFFF;
  
  &:active {
    background-color: #d46b08;
  }
}

.btn-info {
  background-color: #1890ff;
  color: #FFFFFF;
  
  &:active {
    background-color: #096dd9;
  }
}

.btn-outline-primary {
  background-color: transparent;
  color: #1677FF;
  border: 2rpx solid #1677FF;
}

.btn-outline-danger {
  background-color: transparent;
  color: #ff4d4f;
  border: 2rpx solid #ff4d4f;
}

// 按钮大小
.btn-lg {
  height: 90rpx;
  font-size: 36rpx;
}

.btn-sm {
  height: 70rpx;
  font-size: 28rpx;
}

.btn-xs {
  height: 60rpx;
  font-size: 26rpx;
  border-radius: 30rpx;
}

// 禁用状态
.btn-disabled {
  opacity: 0.5;
  pointer-events: none;
}

// 带图标的按钮
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  
  .icon {
    margin-right: 10rpx;
    font-size: 32rpx;
  }
}

// 特殊位置样式

// 底部固定按钮容器
.footer-btn-wrapper {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20rpx 40rpx 40rpx;
  background-color: #F5F7FA;
  z-index: 90;
  box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
}

// 按钮组
.btn-group {
  display: flex;
  justify-content: space-between;
  width: 100%;
  
  .btn {
    margin: 0 10rpx;
    flex: 1;
    
    &:first-child {
      margin-left: 0;
    }
    
    &:last-child {
      margin-right: 0;
    }
  }
}

// 提交按钮容器
.submit-button-container {
  padding: 30rpx 40rpx;
}

// 常用按钮预设
.add-btn {
  @extend .btn;
  @extend .btn-primary;
  @extend .btn-block;
}

.cancel-btn {
  @extend .btn;
  @extend .btn-secondary;
  @extend .btn-block;
}

.submit-btn {
  @extend .btn;
  @extend .btn-primary;
  @extend .btn-block;
}

.delete-btn {
  @extend .btn;
  @extend .btn-danger;
  @extend .btn-block;
}

.edit-btn {
  @extend .btn;
  @extend .btn-info;
  @extend .btn-block;
} 